home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_9951.txt < prev    next >
Text File  |  1989-05-10  |  4KB  |  158 lines

  1. -- card: 9951 from stack: in.6
  2. -- bmap block id: 11204
  3. -- flags: 4000
  4. -- background id: 16130
  5. -- name: PICT Maker 2
  6. ----- HyperTalk script -----
  7. on openCard
  8.   global shown
  9.   put FALSE into shown
  10.   pass openCard
  11. end openCard
  12.  
  13. on closecard
  14.   set name of cd btn ID 3 to "Show Tool Palette"
  15.   hide tool window
  16.   hide pattern window
  17.   put empty into cd fld "Comment"
  18.   show cd btn ID 1
  19. end closecard
  20.  
  21. on idle
  22.   global shown
  23.   if shown then
  24.     if the short name of cd btn ID 3 is "Hide Tool Palette" then
  25.       get the visible of tool window
  26.       if it is FALSE then
  27.         set the name of cd btn ID 3 to "Show Tool Palette"
  28.         hide pattern window
  29.         put FALSE into shown
  30.       end if
  31.     end if
  32.   end if
  33.   pass idle
  34. end idle
  35.  
  36.  
  37.  
  38. -- part 1 (button)
  39. -- low flags: 00
  40. -- high flags: A003
  41. -- rect: left=334 top=32 right=54 bottom=479
  42. -- title width / last selected line: 0
  43. -- icon id / first selected line: 0 / 0
  44. -- text alignment: 1
  45. -- font id: 0
  46. -- text size: 12
  47. -- style flags: 0
  48. -- line height: 16
  49. -- part name: Make PICT Resource
  50. ----- HyperTalk script -----
  51. on mouseUp
  52.   hide me
  53.   show cd fld "Comment"
  54.   put "Select the object to make into a PICT..." into cd fld "Comment"
  55.   put Ants() into theRect
  56.   if theRect is empty then
  57.     put empty into cd fld "Comment"
  58.     show card field "Comment"
  59.     show me
  60.     exit mouseUp
  61.   end if
  62.   put empty into cd fld "Comment"
  63.   choose select tool
  64.   drag from item 1 of theRect,item 2 of theRect to item 3 of theRect,item 4 of theRect -- with optionKey
  65.   doMenu "Copy Picture"
  66.   choose browse tool
  67.   ShowDialog 3,5740, "Please assign a unique ID and name to your PICT resource...","","",11
  68.   if the result is empty then
  69.     show me
  70.     exit mouseUp
  71.   end if
  72.   put the result into temp
  73.   if line 1 of temp = 10 then
  74.     put "this" into where
  75.   else if line 1 of temp = 11 then
  76.     put "other" into where
  77.   else if line 1 of temp = 12 then
  78.     put "file" into where
  79.   end if
  80.   if line 2 of temp is empty then
  81.     put 0 into theID
  82.   else put line 2 of temp into theID
  83.   put line 3 of temp into theName
  84.   put ClipToPICT(theID,theName,where) into temp
  85.   if word 1 of temp = "Error:" then
  86.     put temp into cd fld "Comment"
  87.     show me
  88.     exit mouseUp
  89.   end if
  90.   if temp is not empty then
  91.     put "The new PICT resource is ID" && temp & "." into cd fld "Comment"
  92.   end if
  93.   show me
  94. end mouseUp
  95.  
  96.  
  97.  
  98. -- part 2 (field)
  99. -- low flags: 01
  100. -- high flags: 2002
  101. -- rect: left=7 top=6 right=55 bottom=261
  102. -- title width / last selected line: 0
  103. -- icon id / first selected line: 0 / 0
  104. -- text alignment: 0
  105. -- font id: 3
  106. -- text size: 10
  107. -- style flags: 0
  108. -- line height: 13
  109. -- part name: 
  110.  
  111.  
  112. -- part 3 (button)
  113. -- low flags: 00
  114. -- high flags: A003
  115. -- rect: left=334 top=9 right=31 bottom=479
  116. -- title width / last selected line: 0
  117. -- icon id / first selected line: 0 / 0
  118. -- text alignment: 1
  119. -- font id: 0
  120. -- text size: 12
  121. -- style flags: 0
  122. -- line height: 16
  123. -- part name: Show Tool Palette
  124. ----- HyperTalk script -----
  125. on mouseUp
  126.   global shown
  127.   if the short name of me is "Show Tool Palette" then
  128.     set name of me to "Hide Tool Palette"
  129.     show tool window at 8,72
  130.     show pattern window at 79,72
  131.     put TRUE into shown
  132.   else
  133.     set name of me to "Show Tool Palette"
  134.     hide tool window
  135.     hide pattern window
  136.     put FALSE into shown
  137.   end if
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 7 (field)
  143. -- low flags: 01
  144. -- high flags: 0000
  145. -- rect: left=133 top=283 right=300 bottom=384
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 0 / 0
  148. -- text alignment: 0
  149. -- font id: 3
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: Comment
  154.  
  155.  
  156. -- part contents for card part 2
  157. ----- text -----
  158. To create a PICT resource, draw a picture on the white area of the screen below.  Click the "Make PICT Resource" button to create the resource.